package com.example.computer_exam_training_sys.mapper;

import com.example.computer_exam_training_sys.vo.AdminUserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface AdminUserVOMapper {
    @Select("SELECT a.admin_id, a.user_id, u.username, a.role, a.department, u.email, u.phone, u.real_name, a.status, u.avatar " +
            "FROM admins a LEFT JOIN users u ON a.user_id = u.user_id")
    List<AdminUserVO> selectAllAdminUserVO();

    @Select("SELECT a.admin_id, a.user_id, u.username, a.role, a.department, u.email, u.phone, u.real_name, a.status , u.avatar " +
            "FROM admins a LEFT JOIN users u ON a.user_id = u.user_id WHERE a.admin_id = #{adminId}")
    AdminUserVO selectAdminUserVOByAdminId(Integer adminId);
}
